﻿using System.Collections.ObjectModel;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace dot_in.HTWKAidStation.GUI.Views
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.Data = new ObservableCollection<MyData> { new MyData("asd"), new MyData("qwe"), new MyData("yxc") };
        }

        public ObservableCollection<MyData> Data { get; set; }
    }

    public class MyData
    {
        public MyData(string key)
        {
            this.Items =
                new ObservableCollection<MyNestedData>(new[]
                                                           {
                                                               new MyNestedData("asdcontent"),
                                                               new MyNestedData("qweContent"),
                                                               new MyNestedData("yxcContent")
                                                           });
            this.Key = key;
        }

        public string Key { get; set; }

        public ObservableCollection<MyNestedData> Items { get; set; }
    }

    public class MyNestedData
    {
        public MyNestedData(string item)
        {
            this.Item = item;
        }
        public string Item { get; set; }
    }
}
